package com.apkcore.core.database

import androidx.sqlite.db.SupportSQLiteOpenHelper
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory

class CustomSQLiteOpenHelperFactory(private val dbPath: String) : SupportSQLiteOpenHelper.Factory {
    override fun create(configuration: SupportSQLiteOpenHelper.Configuration): SupportSQLiteOpenHelper {
        val builder = SupportSQLiteOpenHelper.Configuration.builder(configuration.context)
            .name(dbPath)
            .callback(configuration.callback)
        return FrameworkSQLiteOpenHelperFactory().create(builder.build())
    }
}
